<?php
/**
 * The primary key reference of an object
 *
 */
class DBMPrimaryKey {
	/**
	 * The attributes of the primary key
	 *
	 * @var array(DBMAttribute)
	 */
	private $attributes = array();
	
	/**
	 * Add an attribute to this primary key
	 *
	 * @param DBMAttribute $attribute The attribute
	 */
	public function addAttribute(DBMAttribute $attribute){
		// set the attribute as primary key
		$attribute->setPrimaryKey(true);
		
		// store the attribute
		$this->attributes[] = $attribute;
	}
	
	/**
	 * Set the attributes of this primary key
	 *
	 * @param array(DBMAttribute) $attributes
	 */
	public function setAttributes($attributes){
		if(is_array($attributes)){
			$this->attributes = $attributes;
		}
	}
	
	/**
	 * Return the attributes of this primary key
	 *
	 * @return array(DBMAttribute)
	 */
	public function getAttributes(){
		return $this->attributes;
	}
}

?>